From: Juergen Gross Date: Fri, 1 Dec 2017 14:14:07 +0000 (+0100) Subject: libxl: put RSDP for PVH guest near 4GB X-Git-Tag: archive/raspbian/4.11.1-1+rpi1~1^2~66^2~756 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=4a5733771e6f33918eba07b584cccce564a67ac1;p=xen.git libxl: put RSDP for PVH guest near 4GB Instead of locating the RSDP table below 1MB put it just below 4GB like the rest of the ACPI tables in case of PVH guests. This will avoid punching more holes than necessary into the memory map. Signed-off-by: Juergen Gross Acked-by: Wei Liu Reviewed-by: Roger Pau Monné --- diff --git a/tools/libxc/xc_dom_hvmloader.c b/tools/libxc/xc_dom_hvmloader.c index 59f94e51e5..3f0bd65547 100644 --- a/tools/libxc/xc_dom_hvmloader.c +++ b/tools/libxc/xc_dom_hvmloader.c @@ -136,7 +136,7 @@ static int module_init_one(struct xc_dom_image *dom, struct xc_dom_seg seg; void *dest; - if ( module->length ) + if ( module->length && !module->guest_addr_out ) { if ( xc_dom_alloc_segment(dom, &seg, name, 0, module->length) ) goto err; diff --git a/tools/libxl/libxl_x86_acpi.c b/tools/libxl/libxl_x86_acpi.c index 9a7c90467d..fe87418bc1 100644 --- a/tools/libxl/libxl_x86_acpi.c +++ b/tools/libxl/libxl_x86_acpi.c @@ -22,8 +22,6 @@ /* Number of pages holding ACPI tables */ #define NUM_ACPI_PAGES 16 -/* Store RSDP in the last 64 bytes of BIOS RO memory */ -#define RSDP_ADDRESS (0x100000 - 64) #define ACPI_INFO_PHYSICAL_ADDRESS 0xfc000000 struct libxl_acpi_ctxt { @@ -220,7 +218,8 @@ int libxl__dom_load_acpi(libxl__gc *gc, dom->acpi_modules[0].data = (void *)config.rsdp; dom->acpi_modules[0].length = 64; - dom->acpi_modules[0].guest_addr_out = RSDP_ADDRESS; + dom->acpi_modules[0].guest_addr_out = ACPI_INFO_PHYSICAL_ADDRESS + + (1 + acpi_pages_num) * libxl_ctxt.page_size; dom->acpi_modules[1].data = (void *)config.infop; dom->acpi_modules[1].length = 4096;